package org.springblade.mes.purchase.order.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 数据模型
 * @author qp
 */
@Data
@Accessors(chain = true)
@TableName("pur_order_info")
public class OrderInfo extends TenantEntity {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "订单编号")
	private String orderNo;

	@ApiModelProperty(value = "订单名称")
	private String orderName;

	@ApiModelProperty(value = "订单日期")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date orderDate;

	@ApiModelProperty(value = "供应商ID")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long supplierId;

	@ApiModelProperty(value = "供应商编号")
	private String supplierNo;

	@ApiModelProperty(value = "供应商名称")
	private String supplierName;

	@ApiModelProperty(value = "付款方式")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer payMode;

	@ApiModelProperty(value = "税率")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal taxRate;

	@ApiModelProperty(value = "汇率")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal exchangeRate;

	@ApiModelProperty(value = "运输方式")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer transportMode;

	@ApiModelProperty(value = "到货地址")
	private String deliveryAddress;

	@ApiModelProperty(value = "币种")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer currency;

	@ApiModelProperty(value = "运费")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal shipping;

	@ApiModelProperty(value = "备注")
	private String remark;

	@ApiModelProperty(value = "总金额")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal totalBudget;

	@ApiModelProperty(value = "是否签收")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer isSign;

	@ApiModelProperty(value = "签收数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal signNum;

	@ApiModelProperty(value = "本次签收数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal thisSignNum;

	@ApiModelProperty(value = "订单数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal orderNum;

	@ApiModelProperty(value = "申请时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date applyTime;

	@ApiModelProperty(value = "流程实例id")
	private String processInstanceId;

	@ApiModelProperty(value = "流程定义id")
	private String processDefinitionId;

	@ApiModelProperty(value = "创建人姓名")
	private String createUserName;

	@ApiModelProperty(value = "采购员姓名")
	private String purchaserName;

	@ApiModelProperty(value = "合同编号")
	private String contractNo;

	@ApiModelProperty(value = "未税金额")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal untaxedTotal;

	@ApiModelProperty(value = "价税合计")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal taxedTotal;

	@ApiModelProperty(value = "销售订单号")
	private String sellOrderNo;

	@ApiModelProperty(value = "到货状态,未到货,部分到货,全部到货")
	private String arrivalStatus;

	@ApiModelProperty(value = "订单类型(采购/委外)")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer orderType;

	@ApiModelProperty(value = "工艺ID")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long craftId;

	@ApiModelProperty(value = "工艺编码")
	private String craftCode;

	@ApiModelProperty(value = "工艺名称")
	private String craftName;

	@ApiModelProperty(value = "ERP编码")
	private String erpNo;

	@ApiModelProperty(value = "委外状态")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer entrustStatus;

	@ApiModelProperty(value = "发票种类")
	private String invoiceType;

}